<template>
  <div class="jobmore ct">
    <div class="c-new ">
      <el-breadcrumb class="head-nav" :separator-icon="ArrowRight">
        <el-breadcrumb-item :to="{ path: '/yardnews', query: {yardId}  }">站院动态</el-breadcrumb-item>
        <el-breadcrumb-item >通知公告</el-breadcrumb-item>
    </el-breadcrumb>
      <!-- <div class="c-item">
        <div class="item-head">
          <img src="../../assets/job/4.png" alt="">
          <div class="head-txt">科学研究</div>
        </div>
      </div> -->
      <div class="item-content">
        <div class="new-info">
          <div class="info-item" @click="goDetail(item.researchId)" v-for="item in pageSciens.list">
            <div class="info-i-t">
              <div class="i-l">
            {{ item.researchTitle }}
              </div>
              <div class="i-r">
                {{ item.createdTime }}
              </div>
            </div>
          </div>
        </div>
        <div class="item-page">
          <el-pagination
          :current-page="pageSciens.page"
            :page-size="15"
            background
            layout="prev, pager, next, jumper"
            prev-text="上一页"
            next-text="下一页"
            :total="pageSciens.total"
            @current-change="getPageWorkState"
          />
        </div>
      </div>
    </div>
  </div>
</template>
<script setup>
import { useRouter } from 'vue-router';
import { computed, ref, reactive } from 'vue';
import { pageScientificResearch } from '@/api/home';
import { ArrowRight } from '@element-plus/icons-vue'

  const router = useRouter();
  const yardId = computed(() => router?.currentRoute?.value?.query.yardId)
  const goDetail = (id) => {
    router.push(`/yardnewsDetail/${id}?type=science&yardId=${yardId.value}`)
  }

  const pageSciens = reactive({
    list: [],
    total: 0,
    page: 1,
  });
  const getPageScientificResearch = async(pageNum=1) => {
    const params = {
      params: {
        status: true,
      },
      page: {
        pageSize: 15,
        pageNum,
      }
    }
    const ret = await pageScientificResearch(params)
    pageSciens.list = ret?.data?.list || [];
    pageSciens.total = ret?.data?.total;
    pageSciens.page = pageNum;
  }
  getPageScientificResearch();;


</script>
<style lang="scss" scoped>
.jobmore {
  flex: 1;
  width: 100%;
  padding: 0 10%;
  color: #777;
  background: url('../../assets/xiaoyuan/4.jpeg') no-repeat center center / cover;
  .head-nav {
    height: 125px;
    display: flex;
    align-items: center;
    font-size: 24px;
  }

  .c-item {
    width: 100%;
    padding-top: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    .item-head {
      height: 45px;
      width: 100%;
      display: flex;
      align-items: center;
      img {
        width: 40px;
        margin-right: 15px;
      }
      .head-txt {
        font-size: 25px;
      }
    }
  }
  .item-content {
    padding-top: 20px;
    display: flex;
    flex-direction: column;
    .new-info {
      flex: 1;
      background-color: #fff;
      padding: 10px 40px;
      overflow: hidden;
      color: #777;
      .info-item {
        border-bottom: 2px solid #e5e5e5;
        cursor: pointer;
        &:last-child{
          border-bottom: 0 none;
        }
      }
      .info-i-t {
        font-size: 22px;
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 15px 0;
        .i-l {
          text-overflow: ellipsis;
          overflow: hidden;
          white-space: nowrap;
        }
        .i-r {
          margin-left: 40px;
        }
      }
    }
    .item-page {
      height: 160px;
      display: flex;
      align-items: center;
      justify-content: center;
      :deep(.el-pagination) {
        button, li {
          background-color: transparent;
          width: 60px;
          height: 60px;
          border: 2px solid #e5e5e5;
          border-radius: 5px;
          color: #777;
          font-size: 26px;
          font-weight: normal;
          margin-right: 30px;
        }
        button {
          border: 0 none;
        }
        .el-pagination__jump {
          color: #777;
          font-size: 26px;
        }
        .el-pagination__editor {
          min-width: 60px;
          min-height: 60px;
          font-size: 26px;
        }
        .el-input__wrapper {
          padding: 0;
        }
        .el-input__inner {
          color: #777 !important;
        }
      }
    }
  }
}
</style>